home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cgazv5n4.arc
/
HUFF.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-23
|
1KB
|
41 lines
/*--- Listing 1 ------------------------- HUFF.H --------------
* Author: Anton Kruger, 5 October, 1990
*
* Copyright (c) Truda Software
* 814 Benton Drive, #34,
* Iowa City, IA 52246
*
* Description: Include file for the two routines "huff_zip"
* and "huff_unzip" that perform file compression
* using the Huffman algorithm.
--------------------------------------------------------------*/
/* Size of I/O buffers for setvbuff */
#define BUFFER_SIZE 16384
/* Max # of unique symbols in file */
#define MAXSYM 256
/* Max # of nodes in Huffman tree */
#define MAXNOD 2*MAXSYM-1
/* Indicates a left son in tree */
#define LEFT 1
/* Indicates a right son in tree */
#define RIGHT 0
/* Indicates no father, son for node */
#define NONE -1
/* Actual # of unique symbols in file */
int nsymbols;
/* Number of characters in input file */
unsigned long nchars;
int left_son[MAXNOD];
int right_son[MAXNOD];
int father[MAXNOD];
unsigned long freq[MAXNOD];
unsigned char symbol[MAXSYM];
/* Tests bit "ib" in "byte" */
#define btest(byte,ib) (byte & (1<<ib))
/* Sets bit "ib" in "byte" */
#define ibset(byte,ib) (byte | (1<<ib))
#include <limits.h> /* for ULONG_MAX used in build_tree() */